#include <reg51.h>

void mydelay()  // user defined function to introduce delay
{
	int i,j;
 	for(i=0;i<50;i++)
		for(j=0;j<30000;j++) ; 
}

void main()
{		//int i; 
 	while(1){
	 //for (i=0;i<8;i++){ 	P1 = ~(1<<i);mydelay();    }// 0101 0101
	 	P1 = 0x00; P3 = 0xaa; 	 mydelay();    
	 	P1 = 0xff; P3 = 0x55; 	 mydelay();    // 1010 1010 
	}
}
